package com.z3n.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the Z3N_GROUPS database table.
 * 
 */
@Entity
@Table(name="Z3N_GROUPS")
@NamedQueries({@NamedQuery(name = "getZ3nGroupByGroupName", query = "SELECT z FROM Z3nGroup z WHERE z.groupName = :groupName"),@NamedQuery(name = "getZ3nGroupByGroupId", query = "SELECT z FROM Z3nGroup z WHERE z.groupId = :groupId"),
@NamedQuery(name = "getZ3nGroup", query = "SELECT z FROM Z3nGroup z")})
public class Z3nGroup implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="GROUP_ID")
	private int groupId;

	@Column(name="GROUP_NAME")
	private String groupName;

	//bi-directional many-to-one association to Z3nGroupsUser
	@OneToMany(mappedBy="z3nGroup")
	private Set<Z3nGroupsUser> z3nGroupsUsers;

    public Z3nGroup() {
    }

	public int getGroupId() {
		return this.groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public Set<Z3nGroupsUser> getZ3nGroupsUsers() {
		return this.z3nGroupsUsers;
	}

	public void setZ3nGroupsUsers(Set<Z3nGroupsUser> z3nGroupsUsers) {
		this.z3nGroupsUsers = z3nGroupsUsers;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + groupId;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof Z3nGroup)) {
			return false;
		}
		Z3nGroup other = (Z3nGroup) obj;
		if (groupId != other.groupId) {
			return false;
		}
		return true;
	}
	
}